<template>
  <div class="employ">
    <el-form ref="form" :model="form" label-width="85px">
      <!-- <el-row>
        <el-col :span="16">
          <el-form-item label="操作时间段">
            <el-date-picker
              v-model="form.starttime"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>~
            <el-date-picker
              v-model="form.endtime"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8" style="text-align: right;">
          <el-button type="primary" style="width: 120px;" @click="query">查询</el-button>
        </el-col>
      </el-row> -->
      <el-row class="query-params">
          <el-form-item label="操作时间段" class="min-width">
            <el-date-picker
              v-model="form.starttime"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
            <span>~</span>
            <el-date-picker
              v-model="form.endtime"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="会员名称" class="query-input">
              <div class="input-wrap">
                <el-input v-model="form.nickname" placeholder="请输入会员名称"></el-input>
              </div>
          </el-form-item>
          <el-form-item label="手机号码" class="query-input" style="margin-right: auto;">
              <div class="input-wrap">
                <el-input v-model="form.telnum" placeholder="请输入手机号码"></el-input>
              </div>
          </el-form-item>
            <el-button type="primary" class="query-btn" @click="query">查询</el-button>
      </el-row>
    </el-form>
    <ul class="checkTab">
	  <template v-for="item in tabs">
		  <el-badge :value="totalNum" :max="99" :hidden="item.label != '待处理' || totalNum == 0" class="item">
		  <li
		    :key="item.status"
		    v-html="item.label"
		    :class="{'active':form.type===item.status}"
		    @click="clickTab(item)"
		  ></li>
		  </el-badge>
	  </template> 
    </ul>
    <el-table :data="tableData" stripe style="width: 100%" size="small" border>
      <el-table-column label="会员名称" align="center">
        <template slot-scope="scope">
          <el-button
            @click="handleClickNickName(scope.row)"
            type="text"
            size="small"
          >{{scope.row.nickname}}</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="telnum" label="手机号码" align="center"></el-table-column>
      <el-table-column prop="companyname" label="应聘企业名称" align="center">
        <template slot-scope="scope">
          <el-button
            @click="handleClickCompanyName(scope.row)"
            type="text"
            size="small"
          >{{scope.row.companyname}}</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="positionname" label="面试岗位" align="center"></el-table-column>
      <el-table-column prop="entrydate" label="入职时间" align="center"></el-table-column>
      <el-table-column prop="auditdate" label="操作时间" align="center"></el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        width="100"
        align="center"
        v-if="form.type === '1' && (btnAuthority.rzsbBtn || btnAuthority.rzsbBtn)"
      >
        <template slot-scope="scope">
          <div>
            <el-button
              @click="handleAabnormal(scope.row)"
              type="text"
              size="small"
              v-if="btnAuthority.rzsbBtn"
            >处理</el-button>
            <el-button
              @click="handleReport(scope.row)"
              type="text"
              size="small"
              v-if="btnAuthority.rzsbBtn"
            >上报</el-button>
          </div>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="100" align="center" v-if="form.type === '2'">
        <template slot-scope="scope">
          <el-button @click="handleClickDetails(scope.row)" type="text" size="small">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="margin-top: 20px;">
      <el-pagination
        background
        :current-page="form.pagenum"
        :page-size="form.pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        :page-sizes="[10, 20, 30, 50, 100]"
        @current-change="handleCurrentChange"
        @size-change="handleSizeChange"
      ></el-pagination>
    </div>
    <el-dialog :visible.sync="dialogVisible" width="500px">
      <div class="abnormal-dialog-header">
        <span>处理</span>
      </div>
      <div class="abnormal-handle-box">
        <el-row class="abnormal-handle-row">
          <el-col :span="12">
            <el-radio v-model="params.status" label="21">入职</el-radio>
            <el-radio v-model="params.status" label="19">未入职</el-radio>
          </el-col>
        </el-row>
        <el-row class="abnormal-handle-row">
          <el-col :span="16">
            <el-input v-model="params.note" placeholder="备注："></el-input>
          </el-col>
        </el-row>
        <div class="abnormal-dialog-btn">
          <el-button class="cancel-btn" @click="dialogVisible = false">取消</el-button>
          <el-button class="sure-btn" type="primary" @click="submit">确定</el-button>
        </div>
      </div>
    </el-dialog>
    <!-- <el-dialog :visible.sync="dialogVisible" width="680px">
            <div class="abnormal-dialog-header">
                <span>详情</span>
            </div>
            <div class="abnormal-detail-box">
                <div class="abnormal-detail-title">异常信息</div>
                <el-row class="abnormal-detail-row">
                    <el-col :span="12">
                        <span class="col-name">会员名称: </span>
                        <span></span>
                    </el-col>
                    <el-col :span="12">
                        <span class="col-name">电话号码: </span>
                        <span></span>
                    </el-col>
                </el-row>
                <el-row class="abnormal-detail-row">
                    <el-col :span="12">
                        <span class="col-name">面试企业: </span>
                        <span></span>
                    </el-col>
                    <el-col :span="12">
                        <span class="col-name">面试岗位: </span>
                        <span></span>
                    </el-col>
                </el-row>
                <el-row class="abnormal-detail-row">
                    <el-col :span="12">
                        <span class="col-name">面试时间: </span>
                        <span></span>
                    </el-col>
                    <el-col :span="12">
                        <span class="col-name">操作HR: </span>
                        <span></span>
                    </el-col>
                </el-row>
                <el-row class="abnormal-detail-row">
                    <el-col :span="12">
                        <span class="col-name">操作时间: </span>
                        <span></span>
                    </el-col>
                </el-row>
            </div>
            <div class="abnormal-handle-box">
                <div class="abnormal-handle-title">异常处理</div>
                <el-row class="abnormal-handle-row">
                    <el-col :span="12">
                        <el-checkbox v-model="params.checked">未爽约</el-checkbox>
                    </el-col>
                </el-row>
                <el-row class="abnormal-handle-row">
                    <el-col :span="16">
                        <el-input v-model="params.note" placeholder="备注："></el-input>
                    </el-col>
                </el-row>
                <div class="abnormal-dialog-btn">
                    <el-button class="cancel-btn" @click="dialogVisible = false">取消</el-button>
                    <el-button class="sure-btn" type="primary" @click="dialogVisible = false">确定</el-button>
                </div>
            </div>
    </el-dialog>-->
    <el-dialog :visible.sync="dialogVisible1" width="1040px">
      <resume-detail
        v-if="dialogVisible1"
        :userid="userid"
        :nickName="nickName"
        :isShowTelphone="true"
      ></resume-detail>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisible2" width="1040px">
      <company-detail
        v-if="dialogVisible2"
        :companyName="companyname"
        :companyId="companyid"
        :type="'0'"
        :tabNum="'4'"
      ></company-detail>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisible3" width="680px">
      <div class="abnormal-dialog-header">
        <span>详情</span>
      </div>
      <div class="abnormal-detail-box">
        <div class="abnormal-detail-title">异常信息</div>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">会员名称:</span>
            <span class="col-value">{{abnormalDetail.nickname}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">电话号码:</span>
            <span class="col-value">{{abnormalDetail.telnum}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">录用企业:</span>
            <span class="col-value">{{abnormalDetail.companyname}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">个人状态:</span>
            <span class="col-value">{{abnormalDetail.personalstatus}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">企业状态:</span>
            <span class="col-value">{{abnormalDetail.companystatus}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">入职时间:</span>
            <span class="col-value">{{abnormalDetail.entrydate}}</span>
          </el-col>
        </el-row>
        <!-- <el-row class="abnormal-detail-row">
                    <el-col :span="12">
                        <span class="col-name">离职时间: </span>
                        <span class="col-value">{{abnormalDetail.telnum}}</span>
                    </el-col>
        </el-row>-->
      </div>
      <div class="abnormal-handle-box">
        <div class="abnormal-handle-title">处理信息</div>
        <el-row class="abnormal-handle-row">
          <el-col :span="12">
            <span class="col-name">处理结果:</span>
            <span class="col-value" v-html="abnormalDetail.jobstatus === '21'? '入职' : '未入职'"></span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">处理人:</span>
            <span class="col-value">{{abnormalDetail.auditor}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-handle-row">
          <el-col :span="12">
            <span class="col-name">处理时间:</span>
            <span class="col-value">{{abnormalDetail.auditdate}}</span>
          </el-col>
          <el-col :span="12" style="display: flex;">
            <span class="col-name" style="min-width: 40px;">备注:</span>
            <span class="col-value">{{abnormalDetail.remark}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-handle-row">
          <el-col :span="12">
            <span class="col-name">积分扣除对象:</span>
            <span class="col-value">{{abnormalDetail.usertype}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">扣除积分:</span>
            <span class="col-value">{{abnormalDetail.interalnum}}</span>
          </el-col>
        </el-row>
      </div>
    </el-dialog>
  </div>
</template>
<script src='./index.js'></script>
<style scoped src="./index.css"></style>
